#{extends 'main.html' /}
#{set 'title'}Editar#{/set}

<div id="content">
	<div class="row">
		<div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
			<h1 class="page-title txt-color-blueDark">
				<i class="fa fa-table fa-fw "></i> 
				<a href="/admin/Usuarios/all">Editar</a> <span>> &{'admin.users.edit.breadcrumb'}</span>
			</h1>
		</div>
		<div class="col-xs-12 col-sm-5 col-md-5 col-lg-8">
			<ul id="sparks" class="">
				<li class="sparks-info">
					<button  data-target="#add-detail" class="btn btn-primary" data-toggle="modal">&{'admin.users.edit.detail.button.role.add'}</button>
				</li>
				<li class="sparks-info">
					<a href="/admin/Usuarios/all" class="btn btn-default">&{'template.general.button.back'}</a>
				</li>
			</ul>
		</div>
	</div>

	<section id="widget-grid" class="">
		<article class="col-sm-12 col-md-12 col-lg-12">
				
			<div class="jarviswidget" id="wid-id-1" data-widget-colorbutton="false" data-widget-editbutton="false" data-widget-custombutton="false">
				<header>
					<span class="widget-icon"> <i class="fa fa-edit"></i> </span>
					<h2>Editar Usuario</h2>
				</header>

				<div>
					<div class="widget-body no-padding">

						<form class="smart-form" method="POST" action="/admin/Usuarios/update">
							<header>
								<h2>Editar Usuarios</h2>
							</header>

							<fieldset>
								<section>
									<label class="label">Celular:</label>
									<label class="input">
										<input type="text" name="usuario.celular"  value="${entity.celular}">
									</label>
								</section>
								<section>
									<label class="label">Direccion:</label>
									<label class="input">
										<input type="text" name="usuario.direccion" value="${entity.direccion}">
									</label>
								</section>
								<section>
									<label class="label">Correo:</label>
									<label class="input">
										<input type="text" name="usuario.email" value="${entity.email}">
									</label>
								</section>
								<section>
									<label class="label">Nombre:</label>
									<label class="input">
										<input type="text" name="usuario.nombre" value="${entity.nombre}">
									</label>
								</section>
								
								
								<section>
									<label class="label">Password:</label>
									<label class="input">
										<input type="password" name="usuario.password" value="${entity.password}">
									</label>
								</section>
								<section>
									<label class="label">Admin:</label>
									<label class="input">
										<input type="Number" name="usuario.esAdmin" value="${entity.esAdmin}">
									</label>
								</section>
							</fieldset>
							<footer>
								<input type="hidden" name="usuario.id" value="${entity.id}">
								<button type="submit" class="btn btn-primary">
									&{'admin.users.edit.button.update'}
								</button>
							</footer>
						</form>
					</div>
				</div>
			</div>
		</article>

		<article class="col-sm-12 col-md-12 col-lg-12">
			<div class="jarviswidget jarviswidget-color-blueDark" id="wid-id-2" data-widget-colorbutton="false">
				<header>
					<span class="widget-icon"> <i class="fa fa-edit"></i> </span>
					<h2>&{'admin.users.edit.detail.header'}</h2>
				</header>
				<div>
					<div class="widget-body">

						<div class="table-responsive">
							<table class="table table-bordered">
								<thead>
									<tr>
										<th>&{'admin.users.edit.detail.table.header.name'}</th>
										<th></th>
									</tr>
								</thead>
								<tbody>
									
								
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
		</article>
	</section>
</div>

<!-- MODAL FOR DETAILS-->
<div id="add-detail" class="modal fade">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">&{'admin.users.edit.detail.popup.title'}</h4>
			</div>
			<div class="modal-body">
				<form class="smart-form" method="POST" action="/admin/users/add-detail">
					<fieldset>
						<section>
							<label class="label">&{'admin.users.edit.detail.popup.form.label.role'}:</label>
							<label class="select">
								<select name="roleId">
									#{list items:roles, as:'role'}
									<option value="${role.id}">${role.name}</option>
									#{/list}
								</select>
								<i></i> 
							</label>
						</section>
					</fieldset>

					<footer>
						<input type="hidden" name="usuario.id" value="${entity.id}">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<button type="submit" class="btn btn-primary">
							&{'admin.users.edit.detail.popup.button.assign'}
						</button>
					</footer>
				</form>
			</div>
		</div>
	</div>
</div>